package com.jdyinfo.ic.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jdyinfo.ic.mysql.entity.House;
import com.jdyinfo.ic.mysql.entity.Unit;
import com.jdyinfo.ic.mysql.mapper.HouseMapper;
import com.jdyinfo.ic.mysql.mapper.UnitMapper;

@Service("houseService")
public class HouseService {
	@Autowired
	HouseMapper houseMapper;
	
	public List<House> findHouse(int unitId) {
		return houseMapper.findHouseByUnitId(unitId);
	}
	
	public int createHouse(House house) {
		return houseMapper.insertOne(house);
	}
	
	public int updateHouse(House house) {
		return houseMapper.updateOne(house);
	}
	
	public int deleteHouse(int id) {
		return houseMapper.deleteOne(id);
	}
	
}
